package com.hengyi.web.controller.tool;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.hengyi.framework.web.base.BaseController;
import com.hengyi.system.dto.LeiPiDto;

/**
 * build 表单构建
 * 
 * @author qianjiang
 */

/**
 * build 表单构建
 *
 * @author qianjiang
 */
@Controller
@RequestMapping("/tool")
public class BuildController extends BaseController {
    private String prefix = "tool/build";

    @RequiresPermissions("tool:build:view")
    @GetMapping("/build")
    public String build() {
        return prefix + "/build";
    }

    @GetMapping("leipi")
    @RequiresPermissions("tool:leipi:view")
    public String leipi() {
        return "tool/build/leipi";
    }

    @PostMapping("testGetLeiPiHtml")
    @ResponseBody
    public String testGetLeiPiHtml(@RequestBody LeiPiDto dto) {
        System.out.println("Received parametes: " + dto.getHtmlStr());
        return dto.getHtmlStr();
    }
    }
